package com.wang.utils;

import org.springframework.stereotype.Component;

/**
 * @Classname VerifyCodeUtil
 * @Description 专门生成验证码
 * @Date 2024/9/3 9:53
 * @Created by pc
 */
@Component
public class VerifyCodeUtil {

    public String getCode(){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 4; i++) {
            int number = (int)(Math.random() * 10);
            sb.append(number);
        }
        return sb.toString();
    }
}
